package echartstest;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.HashMap;

import com.alibaba.fastjson.JSONArray;

public class GeoCoord {

	static HashMap<String, JSONArray> map=new HashMap<String, JSONArray>();
	static
	{
		try {
			Class.forName("com.mysql.jdbc.Driver");
			String url="jdbc:mysql://172.20.4.226:5029/KKLOG_MID?useUnicode=true&characterEncoding=utf-8";
			Connection conn = DriverManager.getConnection(url,"root","test");
			Statement stat = (Statement) conn.createStatement();
			String sql="SELECT * FROM region_r_code WHERE longitude IS NOT NULL AND latitude IS NOT NULL";
			ResultSet rs=stat.executeQuery(sql);
			while(rs.next())
			{
				String code=rs.getString("code");
				String longitude=rs.getString("longitude");
				String latitude=rs.getString("latitude");
				
				JSONArray jsonArray=new JSONArray();
				jsonArray.add(longitude);
				jsonArray.add(latitude);
				
				map.put(code, jsonArray);
			}
			rs.close();
			stat.close();
			conn.close();
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}

		
		
	}
}
//map.put("北京", "[116.46,39.92]");
//map.put("上海", "[121.48,31.22]");

//map.put("海门", "[121.15, 31.89]");
//map.put("鄂尔多斯", "[109.781327, 39.608266]");
//map.put("招远", "[120.38, 37.35]");
//map.put("舟山", "[122.207216, 29.985295]");
//map.put("齐齐哈尔", "[123.97, 47.33]");
//map.put("盐城", "[120.13, 33.38]");
//map.put("赤峰", "[118.87, 42.28]");
//map.put("青岛", "[120.33, 36.07]");
//map.put("乳山", "[121.52, 36.89]");
//map.put("金昌", "[102.188043, 38.520089]");
//map.put("泉州", "[118.58, 24.93]");
//map.put("莱西", "[120.53, 36.86]");
//map.put("日照", "[119.46, 35.42]");
//map.put("胶南", "[119.97, 35.88]");
//map.put("南通", "[121.05, 32.08]");
//map.put("拉萨", "[91.11, 29.97]");
//map.put("云浮", "[112.02, 22.93]");
//map.put("梅州", "[116.1, 24.55]");
//map.put("文登", "[122.05, 37.2]");
//map.put("上海", "[121.48, 31.22]");
//map.put("攀枝花", "[101.718637, 26.582347]");
//map.put("威海", "[122.1, 37.5]");
//map.put("承德", "[117.93, 40.97]");
//map.put("厦门", "[118.1, 24.46]");
//map.put("汕尾", "[115.375279, 22.786211]");
//map.put("潮州", "[116.63, 23.68]");
//map.put("丹东", "[124.37, 40.13]");
//map.put("太仓", "[121.1, 31.45]");
//map.put("曲靖", "[103.79, 25.51]");
//map.put("烟台", "[121.39, 37.52]");
//map.put("福州", "[119.3, 26.08]");
//map.put("瓦房店", "[121.979603, 39.627114]");
//map.put("即墨", "[120.45, 36.38]");
//map.put("抚顺", "[123.97, 41.97]");
//map.put("玉溪", "[102.52, 24.35]");
//map.put("张家口", "[114.87, 40.82]");
//map.put("阳泉", "[113.57, 37.85]");
//map.put("莱州", "[119.942327, 37.177017]");
//map.put("湖州", "[120.1, 30.86]");
//map.put("汕头", "[116.69, 23.39]");
//map.put("昆山", "[120.95, 31.39]");
//map.put("宁波", "[121.56, 29.86]");
//map.put("湛江", "[110.359377, 21.270708]");
//map.put("揭阳", "[116.35, 23.55]");
//map.put("荣成", "[122.41, 37.16]");
//map.put("连云港", "[119.16, 34.59]");
//map.put("葫芦岛", "[120.836932, 40.711052]");
//map.put("常熟", "[120.74, 31.64]");
//map.put("东莞", "[113.75, 23.04]");
//map.put("河源", "[114.68, 23.73]");
//map.put("淮安", "[119.15, 33.5]");
//map.put("泰州", "[119.9, 32.49]");
//map.put("南宁", "[108.33, 22.84]");
//map.put("营口", "[122.18, 40.65]");
//map.put("惠州", "[114.4, 23.09]");
//map.put("江阴", "[120.26, 31.91]");
//map.put("蓬莱", "[120.75, 37.8]");
//map.put("韶关", "[113.62, 24.84]");
//map.put("嘉峪关", "[98.289152, 39.77313]");
//map.put("广州", "[113.23, 23.16]");
//map.put("延安", "[109.47, 36.6]");
//map.put("太原", "[112.53, 37.87]");
//map.put("清远", "[113.01, 23.7]");
//map.put("中山", "[113.38, 22.52]");
//map.put("昆明", "[102.73, 25.04]");
//map.put("寿光", "[118.73, 36.86]");
//map.put("盘锦", "[122.070714, 41.119997]");
//map.put("长治", "[113.08, 36.18]");
//map.put("深圳", "[114.07, 22.62]");
//map.put("珠海", "[113.52, 22.3]");
//map.put("宿迁", "[118.3, 33.96]");
//map.put("咸阳", "[108.72, 34.36]");
//map.put("铜川", "[109.11, 35.09]");
//map.put("平度", "[119.97, 36.77]");
//map.put("佛山", "[113.11, 23.05]");
//map.put("海口", "[110.35, 20.02]");
//map.put("江门", "[113.06, 22.61]");
//map.put("章丘", "[117.53, 36.72]");
//map.put("肇庆", "[112.44, 23.05]");
//map.put("大连", "[121.62, 38.92]");
//map.put("临汾", "[111.5, 36.08]");
//map.put("吴江", "[120.63, 31.16]");
//map.put("石嘴山", "[106.39, 39.04]");
//map.put("沈阳", "[123.38, 41.8]");
//map.put("苏州", "[120.62, 31.32]");
//map.put("茂名", "[110.88, 21.68]");
//map.put("嘉兴", "[120.76, 30.77]");
//map.put("长春", "[125.35, 43.88]");
//map.put("胶州", "[120.03336, 36.264622]");
//map.put("银川", "[106.27, 38.47]");
//map.put("张家港", "[120.555821, 31.875428]");
//map.put("三门峡", "[111.19, 34.76]");
//map.put("锦州", "[121.15, 41.13]");
//map.put("南昌", "[115.89, 28.68]");
//map.put("柳州", "[109.4, 24.33]");
//map.put("三亚", "[109.511909, 18.252847]");
//map.put("自贡", "[104.778442, 29.33903]");
//map.put("吉林", "[126.57, 43.87]");
//map.put("阳江", "[111.95, 21.85]");
//map.put("泸州", "[105.39, 28.91]");
//map.put("西宁", "[101.74, 36.56]");
//map.put("宜宾", "[104.56, 29.77]");
//map.put("呼和浩特", "[111.65, 40.82]");
//map.put("成都", "[104.06, 30.67]");
//map.put("大同", "[113.3, 40.12]");
//map.put("镇江", "[119.44, 32.2]");
//map.put("桂林", "[110.28, 25.29]");
//map.put("张家界", "[110.479191, 29.117096]");
//map.put("宜兴", "[119.82, 31.36]");
//map.put("北海", "[109.12, 21.49]");
//map.put("西安", "[108.95, 34.27]");
//map.put("金坛", "[119.56, 31.74]");
//map.put("东营", "[118.49, 37.46]");
//map.put("牡丹江", "[129.58, 44.6]");
//map.put("遵义", "[106.9, 27.7]");
//map.put("绍兴", "[120.58, 30.01]");
//map.put("扬州", "[119.42, 32.39]");
//map.put("常州", "[119.95, 31.79]");
//map.put("潍坊", "[119.1, 36.62]");
//map.put("重庆", "[106.54, 29.59]");
//map.put("台州", "[121.420757, 28.656386]");
//map.put("南京", "[118.78, 32.04]");
//map.put("滨州", "[118.03, 37.36]");
//map.put("贵阳", "[106.71, 26.57]");
//map.put("无锡", "[120.29, 31.59]");
//map.put("本溪", "[123.73, 41.3]");
//map.put("克拉玛依", "[84.77, 45.59]");
//map.put("渭南", "[109.5, 34.52]");
//map.put("马鞍山", "[118.48, 31.56]");
//map.put("宝鸡", "[107.15, 34.38]");
//map.put("焦作", "[113.21, 35.24]");
//map.put("句容", "[119.16, 31.95]");
//map.put("北京", "[116.46, 39.92]");
//map.put("徐州", "[117.2, 34.26]");
//map.put("衡水", "[115.72, 37.72]");
//map.put("包头", "[110, 40.58]");
//map.put("绵阳", "[104.73, 31.48]");
//map.put("乌鲁木齐", "[87.68, 43.77]");
//map.put("枣庄", "[117.57, 34.86]");
//map.put("杭州", "[120.19, 30.26]");
//map.put("淄博", "[118.05, 36.78]");
//map.put("鞍山", "[122.85, 41.12]");
//map.put("溧阳", "[119.48, 31.43]");
//map.put("库尔勒", "[86.06, 41.68]");
//map.put("安阳", "[114.35, 36.1]");
//map.put("开封", "[114.35, 34.79]");
//map.put("济南", "[117, 36.65]");
//map.put("德阳", "[104.37, 31.13]");
//map.put("温州", "[120.65, 28.01]");
//map.put("九江", "[115.97, 29.71]");
//map.put("邯郸", "[114.47, 36.6]");
//map.put("临安", "[119.72, 30.23]");
//map.put("兰州", "[103.73, 36.03]");
//map.put("沧州", "[116.83, 38.33]");
//map.put("临沂", "[118.35, 35.05]");
//map.put("南充", "[106.110698, 30.837793]");
//map.put("天津", "[117.2, 39.13]");
//map.put("富阳", "[119.95, 30.07]");
//map.put("泰安", "[117.13, 36.18]");
//map.put("诸暨", "[120.23, 29.71]");
//map.put("郑州", "[113.65, 34.76]");
//map.put("哈尔滨", "[126.63, 45.75]");
//map.put("聊城", "[115.97, 36.45]");
//map.put("芜湖", "[118.38, 31.33]");
//map.put("唐山", "[118.02, 39.63]");
//map.put("平顶山", "[113.29, 33.75]");
//map.put("邢台", "[114.48, 37.05]");
//map.put("德州", "[116.29, 37.45]");
//map.put("济宁", "[116.59, 35.38]");
//map.put("荆州", "[112.239741, 30.335165]");
//map.put("宜昌", "[111.3, 30.7]");
//map.put("义乌", "[120.06, 29.32]");
//map.put("丽水", "[119.92, 28.45]");
//map.put("洛阳", "[112.44, 34.7]");
//map.put("秦皇岛", "[119.57, 39.95]");
//map.put("株洲", "[113.16, 27.83]");
//map.put("石家庄", "[114.48, 38.03]");
//map.put("莱芜", "[117.67, 36.19]");
//map.put("常德", "[111.69, 29.05]");
//map.put("保定", "[115.48, 38.85]");
//map.put("湘潭", "[112.91, 27.87]");
//map.put("金华", "[119.64, 29.12]");
//map.put("岳阳", "[113.09, 29.37]");
//map.put("长沙", "[113, 28.21]");
//map.put("衢州", "[118.88, 28.97]");
//map.put("廊坊", "[116.7, 39.53]");
//map.put("菏泽", "[115.480656, 35.23375]");
//map.put("合肥", "[117.27, 31.86]");
//map.put("武汉", "[114.31, 30.52]");
//map.put("大庆", "[125.03, 46.58]");